import asyncio


async def print1():
    while True:
        print(1)
        await asyncio.sleep_ms(500)


async def print2():
    while True:
        print(2)
        await asyncio.sleep_ms(500)


async def main():
    while True:
        asyncio.create_task(print1())
        asyncio.create_task(print2())
        await asyncio.sleep_ms(1_000)


asyncio.run(main())
